﻿<cvis:BaseLoginView x:Class="Sunboxsoft.ChanceData.Theme.Green.Console.LoginView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:ui="clr-namespace:CPPEI.Coolzon.UI;assembly=CPPEI.Coolzon.UI"
         xmlns:cvis="clr-namespace:Coolvis.UI.Theme.Console;assembly=Sunboxsoft.ChanceData.UI"
             mc:Ignorable="d" 
             d:DesignHeight="1024" d:DesignWidth="768"
         FocusManager.FocusedElement="{Binding ElementName=_ctlEditAccount}">
    <UserControl.Resources>
        <!--定义按钮样式-->
        <Style x:Key="BtnRed" TargetType="Button">
            <Setter Property="Foreground" Value="White"/>
            <!--修改模板属性-->
            <Setter Property="Template">
                <Setter.Value>
                    <!--控件模板-->
                    <ControlTemplate TargetType="Button">
                        <!--背景色-->
                        <Border x:Name="back" Opacity="0.8" CornerRadius="3">
                            <Border.BitmapEffect>
                                <OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}"/>
                            </Border.BitmapEffect>
                            <Border.Background>
                                <ImageBrush ImageSource="../../Resources/Images/login-btn-red.png"/>
                            </Border.Background>
                                <!--按钮内容-->
                            <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding  Content}">
                            </ContentPresenter>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BtnGreen" TargetType="Button">
            <Setter Property="Foreground" Value="White"/>
            <!--修改模板属性-->
            <Setter Property="Template">
                <Setter.Value>
                    <!--控件模板-->
                    <ControlTemplate TargetType="Button">
                        <!--背景色-->
                        <Border x:Name="back" Opacity="0.8" CornerRadius="3">
                            <Border.BitmapEffect>
                                <OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}"/>
                            </Border.BitmapEffect>
                            <Border.Background>
                                <ImageBrush ImageSource="../../Resources/Images/login-btn-green.png"/>
                            </Border.Background>
                            <!--按钮内容-->
                            <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding  Content}">
                            </ContentPresenter>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid>
        <Grid.Background>
            <ImageBrush ImageSource="../../Resources/Images/grid_bg.jpg" TileMode="Tile" AlignmentX="Left" AlignmentY="Bottom"  Viewport="0,0,6,6" ViewportUnits="Absolute"/>
        </Grid.Background>
        <StackPanel Name="_ctlBorderLogin"  HorizontalAlignment="Center" VerticalAlignment="Center">
            <Image Source="../../Resources/Images/login-title.png" Stretch="None" VerticalAlignment="Top" Margin="10,10,10,30"/>
            <Grid Width="630" Height="397">
                <Grid.Background>
                    <ImageBrush ImageSource="../../Resources/Images/Login-bg.png"/>
                </Grid.Background>
                <StackPanel>
                    <TextBox Name="_ctlEditAccount" FontSize="32" Width="450" Height="50" BorderThickness="0" Background="#01000000" Margin="65,93,0,0"/>
                    <PasswordBox x:Name="_ctlEditPassword" FontSize="32" Width="450" Height="50" BorderThickness="0" Background="#01000000" Margin="65,47,0,0"/>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,45,0,0">
                        <Button Name="ctlBtnOK" Content="登陆" FontSize="32" Width="198" Height="60" Margin="5,10,20,0" Click="ctlBtnOK_Click" Style="{StaticResource BtnGreen}"/>
                        <Button Name="ctlBtnCancel" Content="关闭" FontSize="32" Width="198" Height="60" Margin="20,10,5,0" Click="ctlBtnCancel_Click" Style="{StaticResource BtnRed}"/>
                    </StackPanel>
                </StackPanel>
            </Grid>
        </StackPanel>
        <Border Name="_ctlBorderIndicator" BorderBrush="Blue" BorderThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="5" Visibility="Hidden">
            <TextBlock Text="认证中..." Margin="50,20,50,20"/>
        </Border>
    </Grid>
</cvis:BaseLoginView>
